<?php
use yii\helpers\Url;

$this->title = '团队统计';

?>

<?=  yii\web\View::registerCssFile("/js/fullcalendar/dist/fullcalendar.min.css",['depends' => 'app\assets\AppAsset']) ?>
<style type="text/css">
	.fc-content{text-align: center !important;}

</style>

<div class="row">

	<div class="col-md-12">	
		<div class="box box-primary">
		        <div class="box-body no-padding">
		        	<div id="calendar"></div>
		        </div>
		</div>
	</div>
</div>

<div class="modal fade detail-modal" id="DetailModal" role="dialog" aria-labelledby="myLargeModalLabel">
  <div class="modal-dialog " role="document" style="width:800px;">
      <div class="modal-content">
        <!-- 嵌入内容 --> 
      </div>
  </div>
</div>

<div class="modal fade list-modal" id="ListModal" role="dialog" aria-labelledby="myLargeModalLabel">
  <div class="modal-dialog " role="document" style="width:800px;">
      <div class="modal-content">
        <!-- 嵌入内容 --> 
      </div>
  </div>
</div>

<?=  yii\web\View::registerJsFile("/js/moment/moment.js",['depends' => 'dmstr\web\AdminLteAsset']) ?>
<?=  yii\web\View::registerJsFile("/js/fullcalendar/dist/fullcalendar.min.js",['depends' => 'dmstr\web\AdminLteAsset']) ?>
<?=  yii\web\View::registerJsFile("/js/fullcalendar/dist/locale-all.js",['depends' => 'dmstr\web\AdminLteAsset']) ?>


<?php app\components\JsBlock::begin() ?>
<script type="text/javascript">

$(document).ready(function() {
    var initialLocaleCode = 'zh-cn';

    $('#calendar').fullCalendar({
      header    : {
        left  : 'prev,next today',
        center: 'title',
        right : 'month,agendaWeek,agendaDay'
      },
      locale: initialLocaleCode,
      buttonText: {
        today: '今天',
        month: '月',
        week : '周',
        day  : '天'
      },
     
      events : {
           url: "<?=Url::toRoute(['/product/data/data'])?>",
      },
     
      dayClick: function(date, jsEvent, view){
      	var day = date.format();
        console.log(day);
        var url = "<?=Url::toRoute(['/product/data/list'])?>";
        var url_to = '';
        url_to = url+'?day='+day;
        $('#ListModal').modal({
           remote: url_to,
        });
      },
      eventClick: function(calEvent, jsEvent, view) {
    
	        var p_id = calEvent.p_id;
	        var url = "<?=Url::toRoute(['/product/data/detail'])?>";
          var url_to = '';
	        url_to = url+'?product_id='+p_id;
	      	$('#DetailModal').modal({
	      		 remote: url_to,
	      	});
    
      },

 		
    });

});


$('#ListModal').on('hidden.bs.modal', function (e) {
    $(this).removeData();
});

$('#DetailModal').on('hidden.bs.modal', function (e) {
    $(this).removeData();
});

</script>
<?php app\components\JsBlock::end() ?>  